/**
 * Created by zhu on 2016/1/29.
 */
$(function(){
    $.get(contextPath + "/category", function (data) {
        loadData(data);
    });
});

function loadData(data){
    data = jQuery.parseJSON(data);
    $('#category_list');
    $.each(data.list,function(i,item){
        if(item.parent_id == 0){
           var temp = '<li class="item-content" onclick="index('+item.id+')">'+
               '<div class="item-inner">'+
            '<div class="item-title">'+item.name+'</div>'+
            '<div class="item-after"><i class="fa fa-angle-right"></i></div>'+
            '</div>'+
           ' </li>';
            $('#category_list').append(temp);
        }
    });
}